README

This is the software and raw data presented in the paper “Imagery may arise through associations formed through sensory experience: a network of spiking neurons controlling a robot learns visual sequences in order to perform a mental rotation task” by JL McKinstry, JG Fleischer, Y Chen, WE Gall, and GM Edelman.

This repository has three separate components: (1) software that performs neural simulation and controls the humanoid APEX robot, (2) raw data generated from trials performed by the APEX robot performing a mental rotation task, (3) analysis scripts that generated the figures, tests, and measurements presented in the journal article. Obviously (1) is unusable unless you have the APEX robot, but the source code may be useful to better understand the nature of the data in (2)

After downloading this dataset you must unzip the following files before use:
Analysis.zip
Seed000.zip
Seed100.zip
Seed200.zip
Seed300.zip
Seed400.zip
This will create the following subdirectories…

Directory structure:
-
 |
 |-/ Code & data files to run the neural sim;  .mat files resulting from analysis
 |
 |-/analysis tools/ Matlab helper functions for analysis
 |
 |-/matlab/ Analysis scripts for this paper (and also many from previous projects)
 |
 |-/dummydata/ Recorded visual inputs from the robot of certain experiences; used for offline simulation studies but not the data presented here
 |
 |-/final_seedX000_phaseYY Data directories generated by trails with random number seed X and phases of training/testing as reflected below:

Phases:
1) 0 to 128 seconds, Simulation Training:   V1TCs -> V1P23  (OLD JLM)
2) 128 to 168 seconds, Simulation Training: V1P23 -> Pp23   (OLD JLM)
3) 170 to 490 seconds, Robot Conditioning:  MTS->M1
Notes: Delayed Match to Sample -- J 0-degrees to J 0-degrees, then J
0-degrees to mirror-J 0-degrees, do 8 times for each to ensure random seed
statistically sets the behavior MTS->M1 (stimulation), continue for all
A-patterns, 64 in all
4) 490 to 810 seconds, Robot Control Testing: Full Test of 64 trials,
direct match w/ no rotation
5) 810 to 905 seconds, Robot Rotation Training
6) 905 to 1225 seconds, Robot Testing: Full Test of 64 trials, full final
score set here

Key data files:
button_timings.dat: lists time and if there was button press, pressed = 1, non-pressed = 0
DA_Debugger:
lists time, DA value, M1 stimulation current, button press, arm movement, button pressed, coin flip,MTS activity
Note: arm movement needs to be updated for new home position threshold

Useful scripts:
analyzeButtonTiming.m
example cmd:  analyzeButtonTiming(button_timings, 3000, 4999, 5000, 905000, 122000)
analyzeMotorTiming.m
plotShepardAll.m
plotShepardMatches.m
plotShepardMultipleSubjects2.m
score_timing.mat
example command: score_timing(result_times,64)

phase 4 analysis, sample command sequence:
start cmds ***************************
load button_timings.dat
prelim_button_timings_B = button_timings(41:end, :)
addpath ../matlab/
analyzeButtonTiming(prelim_button_timings_B, 3000, 4999, 5000, 905000, 122000)
prelim_result_times = ans
score_timing(ans,64)
size(prelim_result_times)
%reshape(result_times, 8, 8)
%reshape(prelim_button_timings_B, 8, 8)
%reshape(prelim_button_timings, 8, 8)
reshape(prelim_result_times, 8, 8)
end cmds ******************************************

USE plotShepardMultipleSubjects_do_all with no args.  JLM 8-13-14

Analyzing Phase 6 match timings:
analyzeTiming('MTS','p23M',3000, 4999,5000,905000,1220000)

analyzeMotorTiming(motorcommands, 3000, 4999, 5000,905000, 1220000)
plotShepardAll(ans)

NOTE

/matlab/ contains several scripts with names gen_ca_foobar.m or generate_foo_bar.m.  These scripts generated many of the figures in the paper using the methods outlined above. These scripts can be run to regenerate those figures from the data in this repository.




